package com.omall.open.sdk;

import java.io.Serializable;

/**
 * @author 枫伦
 * @description: 洋葱API返回对象
 * @date 2020/10/22 11:51 上午
 */
public abstract class OmallResponse implements Serializable {

    private static final long serialVersionUID = 7239074100428446263L;
    private String body;

    private String errorCode;

    private String errorMessage;

    private boolean success;

    /**
     * 响应内容中的解析的实体类
     * @return
     */
    public abstract Class<?> getResultType();

    /**
     * 将解析后的对象设置到继承的响应对象中
     * @param result
     */
    public abstract void setResult(Object result);

    public boolean isJsonType(){
        return true;
    }


    public String getBody() {
        return this.body;
    }

    public void setBody(String body) {
        this.body = body;
    }

    public String getErrorCode() {
        return this.errorCode;
    }

    public void setErrorCode(String errorCode) {
        this.errorCode = errorCode;
    }

    public String getErrorMessage() {
        return this.errorMessage;
    }

    public void setErrorMessage(String errorMessage) {
        this.errorMessage = errorMessage;
    }

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }
}
